package com.face.pass.active.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * 设备记录表
 * 
 * @author 罗仁进
 *
 */
@Entity
@Table(name = "machine", indexes = { @Index(name = "idx_machine_id", columnList = "machineId"),
		@Index(name = "idx_machine_active", columnList = "active"),
		@Index(name = "idx_machine_ad", columnList = "activeDate") })
public class Machine {
	@Id
	@GeneratedValue
	private Long id;
	// 设备编号
	@Column(unique = true, length = 20)
	private String machineId;
	// 设备地址
	@Column(nullable = true, length = 20)
	private String machineIp;
	// 激活状态 0，未激活 1，激活
	private int active;
	@Column(nullable = true)
	private Date activeDate;
	@Column(nullable = true, length = 255)
	private String license;
	private Date createDate;
	@Column(nullable = true)
	private Date updateDate;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getMachineId() {
		return machineId;
	}

	public void setMachineId(String machineId) {
		this.machineId = machineId;
	}

	public String getMachineIp() {
		return machineIp;
	}

	public void setMachineIp(String machineIp) {
		this.machineIp = machineIp;
	}

	public int getActive() {
		return active;
	}

	public void setActive(int active) {
		this.active = active;
	}

	public Date getActiveDate() {
		return activeDate;
	}

	public void setActiveDate(Date activeDate) {
		this.activeDate = activeDate;
	}

	public String getLicense() {
		return license;
	}

	public void setLicense(String license) {
		this.license = license;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Override
	public String toString() {
		return "ActiveLog [id=" + id + ", machineId=" + machineId + ", active=" + active + ", activeDate=" + activeDate
				+ ", license=" + license + ", createDate=" + createDate + ", updateDate=" + updateDate + "]";
	}

}
